<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <p class="my-p"></p>
    <script>
        const xhr = new XMLHttpRequest()
        xhr.open('GET', 'http://hmajax.itheima.net/api/city?pname=辽宁省')
        xhr.addEventListener('loadend', () => {
            console.log(JSON.parse(xhr.response));
            const data = JSON.parse(xhr.response).list
            console.log(data);
            document.querySelector('.my-p').innerHTML = data.join('<br>')
        })
        xhr.send()
    </script>
</body>

</html>